﻿using Microsoft.Data.Objects;

namespace Defero.Model
{
    /// <summary>
    /// 
    /// </summary>
    public static class PersistenceExtensions
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="property"></param>
        /// <returns></returns>
        public static StringPropertyConfiguration HasDefaultMaxLength(this StringPropertyConfiguration property) 
        {
            return property.HasMaxLength(PersistibleObject.DefaultTextSize);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="property"></param>
        /// <returns></returns>
        public static DecimalPropertyConfiguration HasDefaultMoneyPrecision(this DecimalPropertyConfiguration property)
        {
            return property.HasPrecision(PersistibleObject.DefaultMoneyPrecision, PersistibleObject.DefaultMoneyScale);
        }
    }
}
